{% load i18n %}
<!-- todo delete no use -->
<script >

    function init_withdrawes_collapse() {
        var open_id = []
        $('.withdrawes_listen').on('show.bs.collapse', function () {
//            console.log("4444 ==============")
            // 简单处理，之前的都关闭
            var id =  $(this).attr('id');
            for(var i=0; i<open_id.length; i++) {
                $("#" + open_id[i]).removeClass("in")
            }
            open_id = [id]
        })
    }
</script>

<script id="temp_withdrawes" type="text/html">
    <div class="context-body f-pz"style="background-color: #F1F1F1F1;">
        <div class="panel-group" id="accordion2">
            <table class="table table-hover ">
                <thead>
                    <tr class="bg-white ">
                        <th class="col-sm-2"><%=$imports.gettext('时间')%></th>
                        <th class="col-sm-2"><%=$imports.gettext('币种')%></th>
                        <th class="col-sm-2"><%=$imports.gettext('类型')%></th>
                        <th class="col-sm-2"><%=$imports.gettext('数量')%></th>
                        <th class="col-sm-2">
                            <div><%=$imports.gettext('状态')%></div>
                        </th>
                        <th class="col-sm-2 ">
                            <div class="f-fr"><%=$imports.gettext('详情')%></div>
                        </th>
                    </tr>
                </thead>
                <tbody class="balance_btn">
                    <% for(i = 0; i < jsonobj.length; i ++ ){ %>
                        <% var info = jsonobj[i] %>
                        <% var coin_type = info.coin_type %>
                        <% var create_time = $imports.dateFormat(info.create_time) %>
                        <% var withdraw_time = create_time %>
                        <% if (info.create_time > 0) { %>
                            <% withdraw_time = $imports.dateFormat(info.create_time) %>
                            <% } else { %>
                            <% withdraw_time = "" %>
                            <% } %>
                        <% var amount = info.amount * 1 %>
                        <% var fee = info.fee * 1 %>
                        <% var address = info.address %>
                        <% var status1 = info.status %>
                        <% var confirm_url_test = "https://www.blocktrail.com/tBTC/tx/" + info.txid %>
                        <% var confirm_url = "https://blockchain.info/zh-cn/tx/" + info.txid %>
                        <% var errmsg = info.errmsg %>
                        <% status = "提现成功" %>
                        <% if (status1 == 0) { %>
                            <% status = "提现中" %>
                            <% } %>
                        <% if (status1 == 1) { %>
                            <% status = "正在处理" %>
                            <% } %>
                        <% if (status1 == 2) { %>
                            <% status = "正在处理" %>
                            <% } %>
                        <% if (status1 == 3) { %>
                            <% status = "正在处理" %>
                            <% } %>
                        <% if (status1 == 5) { %>
                            <% status = "提现失败，已经回滚" %>
                            <% } %>
                        <tr>
                            <td colspan=6>
                                <ul class="list-inline  ">
                                    <li class="col-sm-2"><%=create_time%></li>
                                    <li class="col-sm-2"><img src="/static/images/icon/<%=coin_type%>.png" width="16px" height="16px"/> <b><%=coin_type%></b></li>
                                    <li class="col-sm-2">{% trans '提现'%}</li>
                                    <li class="col-sm-2"><%=amount%></li>
                                    <!--
                                    <li><%=address%></li>
                                    -->
                                    <li class="col-sm-2"><%=status%></li>
                                    <li class="col-sm-2 ">
                                    <div class="f-fr">
                                        <a data-toggle="collapse" data-parent="#accordion2" href="#withdraw_<%=info.id%>">{% trans '详情' %}</a>
                                        </li>
                                    </ul>
                                    <div id="withdraw_<%=info.id%>" class="panel-collapse collapse withdrawes_listen">
                                        <div class="panel-body ">
                                            <table class=" col-sm-12 alert-info alert alert-dismissible" role="alert" ">
                                                <tr>
                                                    <td class="f-left"><span>提现时间</span>:<span><%=withdraw_time%></span></td>
                                                    <td class="f-left"><span>手续费</span>:<span><%=fee%></span></td>
                                                </tr>
                                                <tr>
                                                    <td class="f-left"><span>提现地址</span>:<span><%=address%></span></td>
                                                    <% if (status1 == 5) { %>
                                                        <td class="f-left">提现失败，已经撤销:</td>
                                                        <%  } else {%>
                                                        <td class="f-left"><span>区块链交易id</span>:<span><%=info.txid%></span></td>
                                                        <%  } %>
                                                </tr>
                                            </table>
                                        </div>
                                    </div>
                                </td>
                            </tr>
                            <%}%>
                    </tbody>
                </table>
            </div>
        </div>
    </script>
